<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    {% for pic in pics %}
      {% if loop.index0 === 0 %}
        <li data-target="#carousel-example-generic" data-slide-to="{{ loop.index0 }}" class="active"></li>
      {% else %}
        <li data-target="#carousel-example-generic" data-slide-to="{{ loop.index0 }}"></li>
      {% endif %}
    {% else %}
    <p>暂无。。。</p>
    {% endfor %}
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    {% for pic in pics %}
      {% if loop.index0 === 0 %}
      <div class="item active">
        <img src="{{pic.picture}}" alt="...">
        <div class="carousel-caption">
          <div class="wrapper">
            <h3>{{ pic.title }}</h3>
            <p>{{ pic.subtitle }}</p>
          </div>
        </div>
      </div>
      {% else %}
      <div class="item">
        <img src="{{pic.picture}}" alt="...">
        <div class="carousel-caption">
          <div class="wrapper">
            <h3>{{ pic.title }}</h3>
            <p>{{ pic.subtitle }}</p>
          </div>
        </div>
      </div>
      {% endif %}
    {% else %}
    <p>暂无。。。</p>
    {% endfor %}
  </div>

  <!-- Controls -->
  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>
